
<div id="main-content">
  <div class="container-fluid">
    <div class="row-fluid">
			<div class="span12">
				<div class="widget-block">
					<div class="widget-head">
						<h5><?php print $title?></h5>
					</div>
					<div class="widget-content">
            <div class="widget-box">
              <div class="progress">
								<span id="gress" class="orange" style="width: <?php print $persent."%";?>"><span id="percentnya"><?php print $persent;?>%</span></span>
							</div>
              <div class="tooltip-demo well">
								<p style="margin-bottom: 0;" class="muted">
                  <span id="note"></span>
								</p>
							</div>
            </div>
          </div>
				</div>
        <div class="form-actions">
									<button class="btn" onclick="history.go(-1);return false;">Back</button>
								</div>
			</div>
		</div>
  </div>
</div>

<script>
  function olah_ajax(){

    $.post('<?php print site_url("outlet/ajax_eksekusi_db_pos_select/".$total_pos."/".$field_tanggal)?>',{no:3},function(data){
      var obj = jQuery.parseJSON( data );
     // alert(obj.percent);
      $("#percentnya").text(obj.percent+"%");
      $("#gress").width(obj.percent+"%");
      $("#note").text(obj.note);
      console.log(obj);
      var asli = obj.percent * 1;
      if(asli != 100){
        olah_ajax();
      }
      else{
        alert("Finish");
      }
      console.log(obj);
    });
  }
  olah_ajax();
</script>